﻿<Application
    x:Class="Atletika.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Atletika"
    xmlns:localData="using:Atletika.Data">

    <Application.Resources>

        <x:String x:Key="AppName">Slovenská atletika</x:String>
        <x:String x:Key="Competitions">Preteky</x:String>
        <x:String x:Key="DisciplineList">Zoznam disciplín</x:String>

        <x:Int32 x:Key="ARTICLES_TAG">1</x:Int32>
        <x:Int32 x:Key="COMPETITIONS_TAG">2</x:Int32>

        <!-- New Top article template -->
        <DataTemplate x:Key="NewTopArticleTemplate">
            <Grid HorizontalAlignment="Left" Width="510" Height="390">
                <Border Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}">
                    <Image Source="{Binding FullImagePath}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
                </Border>
                <StackPanel VerticalAlignment="Bottom" Background="{ThemeResource ListViewItemOverlayBackgroundThemeBrush}">
                    <TextBlock Text="{Binding PublishInfo}" TextWrapping="NoWrap" Margin="15,0,15,0" FontSize="12"
                               Foreground="{ThemeResource ListViewItemOverlaySecondaryForegroundThemeBrush}" 
                               Style="{StaticResource BaseTextBlockStyle}" />
                    <TextBlock Text="{Binding Title}" TextWrapping="WrapWholeWords" Margin="15,0,15,10"
                        Foreground="{ThemeResource ListViewItemOverlayForegroundThemeBrush}" 
                        Style="{StaticResource SubheaderTextBlockStyle}" />
                </StackPanel>
            </Grid>
        </DataTemplate>

        <!-- Article template -->
        <DataTemplate x:Key="NewArticleTemplate">
                <Grid HorizontalAlignment="Left" Width="250" Height="190">
                    <Border Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}">
                        <Image Source="{Binding FullImagePath}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
                    </Border>
                    <StackPanel VerticalAlignment="Bottom" Background="{ThemeResource ListViewItemOverlayBackgroundThemeBrush}">
                        <TextBlock Text="{Binding PublishInfo}" TextWrapping="NoWrap" Margin="15,0,15,0" FontSize="12"
                               Foreground="{ThemeResource ListViewItemOverlaySecondaryForegroundThemeBrush}" 
                               Style="{StaticResource BaseTextBlockStyle}" />
                        <TextBlock Text="{Binding Title}" Height="40" Margin="15,0,15,10"
                               Foreground="{ThemeResource ListViewItemOverlayForegroundThemeBrush}" 
                               Style="{StaticResource TitleTextBlockStyle}"  />
                    
                    </StackPanel>
                </Grid>
        </DataTemplate>

        <!-- Small article template -->
        <DataTemplate x:Key="SmallArticleTemplate">
            <Grid HorizontalAlignment="Left" Width="220" Height="170">
                <Border Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}">
                    <Image Source="{Binding FullImagePath}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
                </Border>
                <StackPanel VerticalAlignment="Bottom" Background="{ThemeResource ListViewItemOverlayBackgroundThemeBrush}">
                    <TextBlock Text="{Binding Title}" Foreground="{ThemeResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource BaseTextBlockStyle}" Height="40" Margin="15,0,15,0" />
                    <TextBlock Text="{Binding Perex}" Foreground="{ThemeResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource BaseTextBlockStyle}" TextWrapping="NoWrap" Margin="15,0,15,10" FontSize="12"/>
                </StackPanel>
            </Grid>
        </DataTemplate>

        <!-- Competition template -->
        <DataTemplate x:Key="CompetitionTemplate">
            <Grid Height="190" Width="200">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Border Background="White" Height="118" >
                    <Image Source="{Binding ImagePath}" HorizontalAlignment="Center" Stretch="None" AutomationProperties.Name="{Binding Name}"/>
                </Border>
                <StackPanel Grid.Row="1" Margin="0,2,0,0">
                    <TextBlock Text="{Binding sDate}" TextWrapping="NoWrap" Margin="5,0,0,0" FontSize="12"
                               Foreground="{ThemeResource ListViewItemOverlaySecondaryForegroundThemeBrush}" 
                               Style="{StaticResource BaseTextBlockStyle}" />
                    <TextBlock Text="{Binding Name}" TextWrapping="Wrap" Margin="5,0,0,0" Height="40"
                               Style="{StaticResource TitleTextBlockStyle}" />
                </StackPanel>
            </Grid>
        </DataTemplate>

        <!-- DisciplineList template -->
        <DataTemplate x:Key="DisciplineListTemplate">
            <Border Background="SteelBlue" Margin="2" Padding="10">
                <Grid Height="100" Width="300">
                    <StackPanel>
                        <TextBlock Text="{Binding Name}" Style="{StaticResource SubheaderTextBlockStyle}" MaxHeight="60" FontFamily="Global User Interface" Margin="0,0,0,10" />
                        <TextBlock Text="{Binding sDateTime}" Style="{StaticResource BodyTextBlockStyle}" TextWrapping="Wrap" FontFamily="Global User Interface"/>
                    </StackPanel>
                </Grid>
            </Border>
        </DataTemplate>

    </Application.Resources>
</Application>
